<?php
class MyApp extends CommonApp {
   
   //主页
    public function indexAct(){
    	//display
      if(isset($_SESSION['member']))
        $this->assign('member',$_SESSION['member']);
      $this->display();
    }

    //获得商品
    public function  gainAct(){
      $this->checklogin();
      $result = DB('order')->where("member_id = '{$_SESSION['member']['id']}'")->clear()->select();
      foreach ($result as &$value) {
        $value['params'] = DB('goods')->where("id = '{$value['goodsid']}'")->find();
      }
      $this->assign('result',$result);
    	$this->display();  
    }

    //商品详情
    public function gain_detailAct(){
      $this->checklogin();
    	$this->display();
    }

    //商品物流
    public function gain_logisticsAct(){
        $id = My::arr2var($_GET,'id');
        if($id){
          $result = DB('order')->where("goodsid={$id}")->find();
          $result['image'] = DB('goods')->where("id = {$id}")->getField('image');
          $result['type'] = M('admin.category')->item2submenu('logistics',array('level'=>'1'));
          $e = new Express();
          $result['logistics'] = $e->getLogisticsInfo($result['logistics_id']);
          $this->assign('result',$result);
          $this->display();
        }
        
    }

    //帮助中心
    public function helpAct(){
    	$this->display();
    }
   
   	//帮助列表
   	public function helplistAct(){
   		$this->display();
   	}

   	//我的钱包
   	public function walletAct(){
      $this->checklogin();
   		$this->display();
   	}

   	//钱包使用详情
   	public function wallet_detailAct(){
      $this->checklogin();
   		$this->display();
   	}

   	//钱包积分
   	public function wallet_scoreAct(){
      $this->checklogin();
   		$this->display();
   	}

   	//晒单
   	public function commentAct(){
      $this->checklogin();
   		$this->display();
   	}
   	//晒单详情
   	public function comment_detailAct(){
      $this->checklogin();
   		$this->display();
   	}

    //地址管理
    public function addressAct(){
      $this->checklogin();
      $this->display();
    }

}